def isPerfectNumber(n):
    if n <= 0:
        return False
    factor_sum = 0
    for i in range(1, n):
        if n % i == 0:
            factor_sum += i
    return factor_sum == n 
n=eval(input("请输入一个整数："))
print(isPerfectNumber(n))